package com.buobao.oa.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.util.Arrays;
import java.util.stream.Stream;

public class MD5Utils {
    public static String md5Digest(String source) {
        return DigestUtils.md5Hex(source);
    }


    public static String md5Digest(String source,Integer salt) {
        char[] ca = source.toCharArray();
        for (int i=0;i<ca.length;i++) {
            ca[i] = (char) (ca[i]+salt);
        }
        return MD5Utils.md5Digest(new String(ca));
    }
}
